The present invention relates to a digital imaging apparatus, having an auto-focus function, including a digital camera and a camera attached to a mobile phone and, more particularly, to a technique to improve the focus position accuracy of a digital imaging apparatus.
In a digital camera, the equipping of an auto-focus function for automatically focusing the camera has become widespread due to the increase in the number of pixels and an advance in functionality. The present invention is an invention of an auto-focus technique for judging a focus position by a detection value at each measurement point by shifting the focal point by moving the position of a lens.
In general, the focus state of an image is judged by the amount of high frequency components extracted by subjecting imaging data obtained by an imaging device, such as a CCD and a CMOS sensor, to a bypass filter, however, there may be various other methods. The auto-focus system is described in, for example, patent documents 1 and 2, and is widely known, and therefore, the explanation is omitted here. The present invention can be used for a detection method of any focus state and here, a value indicating a focus state calculated from imaging data is referred to as an AF detection value.
In a general auto-focus system, a lens is moved at a predetermined pitch from a nearest point (the infinite end side in the focus range) toward a farthest point (the proximate end side in the focus range) in a movement range (focus range), the AF detection value is calculated from the imaging data at each point, the position at which the AF detection value is maximum is determined as the focus position, and the lens is moved to this position. Specifically, the lens is moved from the nearest point toward the farthest point, the beginning of a decrease in the AF detection value after it has passed the peak value is detected, and the lens is moved to the position of the peak value. This method is called a mountain-climbing method.
FIG. 1A and FIG. 1B are diagrams for explaining processing of judging the focus position by the above-mentioned conventional system; FIG. 1A shows the measurement values of the focal distance and the AF detection value at the measurement points and FIG. 1B shows a graph when the horizontal axis represents the focal distance and the vertical axis represents the evaluation value (AF detection value).
In this example, the lens is moved sequentially from the infinite end side (50,000 mm) in the focus range toward the proximate side in the focus range while calculating the AF detection value and the calculated AF detection value is used as the evaluation value. The focal distance at which the AF detection value is maximum (the peak value) is judged to be the focal position, however, in this example, it is judged that the position at 50 mm on the proximate side shown by P is best in focus and the lens is moved thereto.
In general, the calculation of the AF detection value is performed for the imaging data in a predetermined range (AF detection frame), as an object, among imaging data acquired by the imaging apparatus. There is a case where plural ranges are included however, the most general range is a case where one range is included in the center portion of an image.
FIG. 2A and FIG. 2B are examples of an image photographed by a digital camera, a composition in which reference number 1 denotes a display frame of an image display device such as an LCD, 2 denotes an AF detection frame, and a human being 3 is located in the center of the image. FIG. 2A is an image when the lens is located at the infinite end and FIG. 2B is an image when the lens is at the proximate end. In this case, the image in FIG. 2B will be magnified than the image in FIG. 2A due to the influence of the optical zoom (there may be a case where the situation is reversed, that is, the image is reduced, depending on the lens configuration). The degree of magnification differs depending on the lens configuration. The AF detection frame 2 is constant irrespective of input images and therefore the subject (human being) in the AF detection frame 2 is magnified in the image in FIG. 2B.
As shown in FIG. 2A and FIG. 2B, if an object with high luminance, such as a fluorescent lamp, is included in the AF detection frame 2, the fluorescent lamp 4 is also magnified due to the influence of the optical zoom and the ratio occupied by the fluorescent lamp 4 with high luminance within the AF detection frame 2 increases, affecting the AF detection value. Consequently, if the focus position is judged using only the AF detection value as the evaluation value, the phenomenon of magnification of the object with high luminance becomes outstanding on the proximate side due to the influence of the optical zoom and an erroneous judgment is made that the focus position is located at a position nearer to the proximate side than the original position of the subject.
Japanese Unexamined Patent Publication (Kokai) No. 8-15601 describes an auto-focus circuit that has reduced the influence of luminance by detecting the average value of the high region component of a luminance signal in an integrator circuit as well as detecting the peak value (corresponding to the AF detection value) of the high region component of the luminance signal in the auto-exposure (AE)-controlled imaging signal (data) and by multiplying a predetermined coefficient to calculate a direct current level and subtracting the peak value in the high region component.
Further, Japanese Unexamined Patent Publication (Kokai) 2005-338514 describes a lens control apparatus that calculates the difference value between the luminance value multiplied by a predetermined coefficient and the contrast value (corresponding to the AF detection value) and changes the movement direction and the movement speed of the lens when the difference value is greater than a threshold value.